﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RunUOGenerator
{
    public partial class CheckboxControl : BaseTabControl
    {
        private string _OverrideValue = "false";

        public CheckboxControl()
        {
            InitializeComponent();
        }
        /// <summary>
        /// Sets or gets the Value of this control.
        /// </summary>
        public override string Value
        {
            set
            {
                this.checkBox.Checked = bool.Parse(value);
            }
            get 
            {
                if (_OverrideValue != "" || _OverrideValue != null)
                    return _OverrideValue;
                else
                    return this.checkBox.Checked.ToString(); 
            }
        }
        /// <summary>
        /// Sets or gets the OverrideValue of this control.
        /// </summary>
        public string OverrideValue
        {
            set
            {
                _OverrideValue = value;
            }
            get { return _OverrideValue; }
        }
        /// <summary>
        /// Sets or gets the Text of this control.
        /// </summary>
        public override string Text
        {
            set
            {
                this.checkBox.Text = value;
            }
            get { return this.checkBox.Text; }
        }

        public bool Checked
        {
            get { return checkBox.Checked; }
        }
    }
}
